//
//  BaseViewController.h
//  Trackit
//
//  Created by yaodaobin on 2017/4/2.
//  Copyright © 2017年 yaodaobin. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Masonry.h"
#import "UIBarButtonItem+ClearBackground.h"
#import "UINavTitleLabel.h"
#import "UIAlertController+Blocks.h"
#import "JXTAlertManagerHeader.h"

#define APP_DELEGATE ((AppDelegate *)[UIApplication sharedApplication].delegate)

#define intStringFromDictValue(a) [NSStringUtil intStringFromDictValue:a]


typedef void(^LoginResult_block)(NSDictionary *data, NSError *error, BOOL loginSuccess);

@interface BaseViewController : UIViewController <UIGestureRecognizerDelegate>  {
    UITapGestureRecognizer* _tapGesture;
    BOOL _reloading;    // 刷新
    UIView *_waitingIcon;//加载loading 框
}

@property (nonatomic, copy) LoginResult_block loginResult_block;//登录、注册成功回调
@property (nonatomic, strong) UINavTitleLabel *navLabel;

+ (UIViewAnimationOptions)animationOptionsForCurve:(UIViewAnimationCurve)curve;
- (void)initParams;
- (void)initUI;
- (void)back;
- (void)showWaitingIcon:(CGFloat)verticalOffset;
- (void)showWaitingIcon;
- (void)dismissWaitingIcon;
- (void)setCustomTitle:(NSString *)title;
- (BOOL)needLogin;
- (BOOL)needLogin:(LoginResult_block)block;
- (void)login;
- (void)login:(LoginResult_block)block;
- (void)needLoginDo:(void (^)())block;

@end
